package com.baijia.exception;

/**
 * Created by dudu on 16/6/24.
 */
public enum ErrorCode {

    OK(0, "success"),

    NEED_CAPTCHA(10000, "需要图形验证码"),

    NEED_BIND_ACCOUNT(10100, "需要绑定登录帐号"),

    MOBILE_NULL_ERROR(10001, "手机号码不能为空"),

    MOBILE_EXIST_ERROR(10002, "手机号码已经存在"),

    // FIXME code重复，需要与业务方确认是否有针对code做二次封装，之后再改
    MOBILE_NOT_EXIST_ERROR(10002, "手机号码不存在"),

    CREDENTIALS_ERROR(10003, "用户名不存在"),

    PASSWORD_NULL_ERROR(10004, "密码不能为空"),

    OLD_PASSWORD_NULL_ERROR(10005, "原密码不能为空"),

    OLD_PASSWORD_ERROR(10006, "原密码错误"),

    RE_PASSWORD_ERROR(10007, "新密码和确认密码不相等"),

    LOGIN_NEED_ERROR(10008, "您需要登录才能执行该操作"),

    CODE_NULL_ERROR(10010, "短信验证码不能为空"),

    CODE_INVALID_ERROR(10011, "短信验证码无效"),

    CAPTCHA_NULL_ERROR(10012, "请输入图形验证码"),

    CAPTCHA_INVALID_ERROR(10013, "图形验证码无效"),

    SYN_DATA_ERROR(10015, "同步数据发生错误"),

    RESET_PASSWORD_FAIL(10020, "重置密码失败"),

    CREATE_ACCOUNT_FAIL(10021, "创建新账户失败"),

    UPDATE_PASSWORD_FAIL(10022, "修改密码失败"),

    VALIDATE_MOBILE_ERROR(10023, "验证手机号码发生错误"),

    BIND_MOBILE_ERROR(10024, "绑定手机号码发生错误"),

    THIRD_LOGIN_ERROR(10025, "第三方登录发生错误"),

    THIRD_UID_NULL_ERROR(10026, "第三方登录uid为空"),

    MOBILE_ALREADY_BOUND(10027, "该手机号已绑定其他账号"),

    PAYMENT_PASSWORD_VALIDATION_ERROR(10028, "支付密码验证错误"),

    BANK_CARD_VALIDATION_ERROR(10029, "银行卡号或身份证号验证错误"),

    QRCODE_SCAN_NOT_LOGIN_ERROR(10080, "二维码已经扫码但是还未登录"),

    QRCODE_NOT_SCAN_ERROR(10081, "二维码尚未被扫码"),

    QRCODE_EXPIRED_ERROR(10090, "二维码已失效，请重新扫码"),

    BUSINESS_ERROR(500, "业务处理异常"),

    SYSTEM_ERROR(900, "系统处理异常");

    private int code;

    private String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
